struct PlanetaRPC {
	unsigned 	id;
	int			tamanio;
	float		posx;
	float		posy;
};

struct UniversoRPC {
	unsigned 	id;
	unsigned	min;
	unsigned	max;
	unsigned	ttl;
/*	string		descripcion<>; */
};

typedef UniversoRPC ArrayUniversoRPC<>;

struct JuegoRPC {
	unsigned 		id;
	unsigned		min;
	unsigned		max;
/*	string			descripcion<>; */
	UniversoRPC		universo;
};

typedef JuegoRPC ArrayJuegoRPC<>;

typedef PlanetaRPC ArrayPlanetaRPC<>;

program DIRECTORIO_RPC_PROG {
 	version DIRECTORIO_RPC_VERS {
 		unsigned CREAR_UNIVERSO(unsigned min, unsigned max, unsigned ttl) = 0;
 		bool DESTRUIR_UNIVERSO(unsigned id) = 1;
 		unsigned SUSCRIBIR_PLANETA(unsigned idUniverso, unsigned host, 
 			int tamanio, float posx, float posy) = 2;
 		bool CANCELAR_PLANETA(unsigned idPlaneta, unsigned idUniverso) = 3;

 		unsigned CREAR_JUEGO(unsigned min, unsigned max, unsigned idUniverso) = 4;
 		bool DESTRUIR_JUEGO(unsigned idJuego) = 5;
 		unsigned SUSCRIBIR_JUGADOR(unsigned idJuego, unsigned host) = 6;
 		bool CANCELAR_JUGADOR(unsigned idJugador, unsigned idJuego) = 7;
 		bool JUGADOR_LISTO(unsigned idJugador, unsigned idJuego) = 8;

 		bool CERRAR_UNIVERSOS() = 9; 
 		bool CERRAR_JUEGOS() = 10; 

 		ArrayUniversoRPC LISTAR_UNIVERSOS_ABIERTOS() = 11;
 		ArrayUniversoRPC LISTAR_UNIVERSOS_CERRADOS() = 12;
 		ArrayJuegoRPC LISTAR_JUEGOS_ABIERTOS() = 13;
 		ArrayPlanetaRPC LISTAR_PLANETAS(unsigned idUniverso) = 14;

 		void INICIALIZAR() = 15;
 		void TERMINAR() = 16;
 		
 		unsigned RESOLVER_PLANETA(unsigned idUniverso, unsigned idPlaneta) = 17;
 		
 		PlanetaRPC GET_INFORMACION_PLANETA(unsigned idUniverso, 
 			unsigned idPlaneta) = 18;
		
 	} = 1;
} = 200000;
